//
//  OrderSelectPayCell.m
//  CenturyCity
//
//  Created by beisheng03 on 2018/1/10.
//  Copyright © 2018年 beisheng. All rights reserved.
//

#import "OrderSelectPayCell.h"
@interface OrderSelectPayCell ()
@property (weak, nonatomic) IBOutlet UIImageView *leftImageView;
@property (weak, nonatomic) IBOutlet UILabel *topLabel;
@property (weak, nonatomic) IBOutlet UILabel *bottomLabel;
@property (weak, nonatomic) IBOutlet UIButton *rightBtn;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomMargin;

@end
@implementation OrderSelectPayCell

- (void)awakeFromNib {
    [super awakeFromNib];
    
    
    self.bottomMargin.constant = 0;
    
    self.rightBtn.userInteractionEnabled = NO;
    
    
    
    self.topLabel.font = MYFONT(14);
    
    self.bottomLabel.font = MYFONT(13);
    
    self.bottomLabel.textColor = darkGray;
    
    self.rightBtn.imageEdgeInsets = UIEdgeInsetsMake(10, 10, 10, 10);
    // Initialization code
}


- (void)setModel:(OrderSureModel *)model{
    
    _model = model;
    
    if (self.index.row == 0) {
        
        if ([_model.alipay isEqualToString:@"1"]) {
            self.rightBtn.selected = YES;
        } else {
            self.rightBtn.selected = NO;
            
        }
        
    } else {
        
        if ([_model.wechatPay isEqualToString:@"1"]) {
            
            self.rightBtn.selected = YES;
            
        } else {
            
            self.rightBtn.selected = NO;
            
        }
        
    }
    
}





- (void)setIndex:(NSIndexPath *)index{
    _index = index;
    
    if (index.row == 0) {
        self.topLabel.text = @"支付宝支付";
        self.bottomLabel.text = @"推荐有支付宝账户的用户使用";
        self.leftImageView.image = [UIImage imageNamed:@"payImage06"];
    } else {
        self.topLabel.text = @"微信支付";
        self.bottomLabel.text = @"推荐安装微信5.0以上版本使用";
        self.leftImageView.image = [UIImage imageNamed:@"payImage05"];
        
    }
    
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
